package com.hjm.project.terminal.library.common;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hjm.common.utils.EncyptorUtil;
import com.hjm.project.terminal.library.domain.TerminalLibrary;

public class T {

    public static void test(){
        JSONArray successArray = JSONObject.parseArray("[{\"tusn\":\"160000888997777265\",\"sn\":\"3532000067\"}]");
        for (int i = 0; i < successArray.size(); i++) {
            JSONObject jsonObject = (JSONObject)successArray.get(i);
            String machine_num = jsonObject.getString("tusn");
            String channel_sn = jsonObject.getString("sn");

            TerminalLibrary tl = new TerminalLibrary();
            tl.setTmk(new EncyptorUtil().getRandomString(32));
            tl.setChannelPosno(channel_sn);
            tl.setMachineNum(machine_num);
            tl.setIsSync(1);
            tl.setNote("同步成功");
            System.out.println(111111);
        }
    }

    public static void main(String[] args) {

        test();
    }
}
